cmake_minimum_required(VERSION 3.00)
project(09-httpd)

set(CMAKE_CXX_STANDARD 17)

add_executable(${PROJECT_NAME}
        httpd.cpp
        router.cpp
        handler.cpp
)

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        pthread
        libhv.a
)

message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
    add_definitions(-DDEBUG)
else()
    add_definitions(-DNDEBUG)
endif()

EXECUTE_PROCESS(COMMAND cp -rf ${PROJECT_SOURCE_DIR}/etc ${PROJECT_BINARY_DIR}/)
EXECUTE_PROCESS(COMMAND cp -rf ${PROJECT_SOURCE_DIR}/html ${PROJECT_BINARY_DIR}/)
